<!-- 
    @author Wójcik Karol <wojcikk@student.agh.edu.pl>
    @licence http://www.gnu.org/copyleft/gpl.html GNU/GPL
-->

<div id="colOne">
    <%= render :partial => "menu" %>
</div>
<div id="colTwo">
<% if @groups.blank? %>
    <h1>Aktualnie nie ma dost&#281;pnych grup</h1>
<% else %> 

<h1>Grupy</h1>

<table>
  <tr>
    <th>Przedmiot</th>
	<th><a href="/groups/list">Prowadzacy</a></th>
    <th>Typ zajec</th>
    <th>Dzien tygodnia</th>
    <th>Godzina</th>
    <th>Sala</th>
  </tr>
  
<% for group in @groups %>
  <tr>
    
    <td><%=h group.lesson.subject.name %></td>
	<td><%=h "#{group.user.name} #{group.user.surname}" %></td>
    <td><%=h group.lesson.class_type.name %></td>
    <td><%=h group.day %></td>
    <td><%=h group.period %></td>
    <td><%=h group.classroom %></td>
        
    <td><%= link_to 'Show', :action => 'show', :id => group %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => group %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy', :id => group }, :confirm => 'Are you sure?', :post => true %></td>
  </tr>
  
<% end %>


</table>

<br><br><br>
Click on head of column you want to sort

<%= link_to 'Previous page', { :page => @group_pages.current.previous } if @group_pages.current.previous %>
<%= link_to 'Next page', { :page => @group_pages.current.next } if @group_pages.current.next %> 

<br />
<% end %>


</div>